#ifndef PROXYMGRDLG_H
#define PROXYMGRDLG_H

#include "publicstruct.h"
//#include <QDialog>

class TDomain ;

namespace Ui {
class ProxyMgrDlg;
}

class ProxyMgrDlg : public QDialog
{
    Q_OBJECT

public:
    explicit ProxyMgrDlg(QWidget *parent = nullptr);
    ~ProxyMgrDlg();
    TDomain *m_tDomain;
    QStandardItemModel *m_tableModel;

private slots:
    void on_btn_close_clicked();

    void on_btn_updateProxy_clicked();

    void on_btn_checkProxy_clicked();

    void on_btn_delProxy_clicked();

    void onFinished(QNetworkReply *reply);
    void dataReceivedFromSocket(const QByteArray data, const QString requestParam);
    void onRecvProxyStatus(const QString &validatedProxy, QString retStr);
    void on_btn_stopCheck_clicked();

    void on_cb_proxyStatus_currentTextChanged(const QString &arg1);
    void taskInterruptDeal();
    void on_pbt_testProxyDest_clicked();

signals:
    void stopThread();
private:
    Ui::ProxyMgrDlg *ui;
//    QNetworkAccessManager manager;
//    QNetworkRequest request;
//    QNetworkReply *reply;
    bool m_changeProxy;
    DataDict  m_testProxyDest;
    QVector<ProxyServerData> m_allProxyServer;
    QVector<ProxyServerData> m_selectProxyServer;
    int m_progressBarTotal,m_progressBarCurrent;
    void initUi();
    void refleshTable(QVector<ProxyServerData> qvpsd);
    void startCheckProxy(QVector<ProxyServerData> qvpsd);

};

#endif // PROXYMGRDLG_H
